import { forwardRef, useImperativeHandle, useState } from "react"
import { Button, Modal, Input, Table, Space, Form, Pagination, Select, Radio, Image, Upload, DatePicker, Divider, DatePickerProps, TreeSelect, Switch } from 'antd';
import { SubTableConfig } from "../../../utils/types";


interface Props {
    onFinish?: Function
}

const SubTablePreViewModal = (props: Props, ref: any) => {
    useImperativeHandle(ref, () => ({
        openModal: openModal
    }))

    const [isModalOpen, setIsModalOpen] = useState(false);
    const [currentSubTableConfig, setCurrentSubTableConfig] = useState<SubTableConfig>(null);

    const handleConfirm = async () => {

    }

    const openModal = (subTableConfig: SubTableConfig) => {
        setIsModalOpen(true)
    }

    const handleCancel = () => {
        setIsModalOpen(false)
    }

    return (
        <Modal
            title={'插入效果预览'}
            open={isModalOpen}
            onOk={handleConfirm}
            onCancel={handleCancel}
            okText={''}
            okButtonProps={{
                style: {
                    display: 'none'
                }
            }}
            cancelText={'取 消'}
            width={1000}
            maskClosable={false}
            centered
        >
            <div className="sub-table-preview-modal">
            <div className="word-A4-container">
                <div className="word-A4-content">

                </div>
            </div>
            </div>
        </Modal>
    )
}


export default forwardRef(SubTablePreViewModal);